//
//  YATaskUserAddAttention.m
//  YoucApi
//
//  Created by Liam on 11/27/12.
//
//

#import "YATaskUserAddAttention.h"

@implementation YATaskUserAddAttention

TASK_AUTO_REGISTER(TaskUserAddAttention);

- (NSString *)_getUriParamA
{
	return @"add_user_attention";
}

- (BOOL)_checkValidResponse:(id)responseObject
{
	return YES;
}

- (NSInteger)apiErrorCodeFromErrorCode:(NSInteger)code
{
    switch (code) {
        case 1:
            code = YoucApiErrorAddAttentionIDNotFound;
            break;
		case 2:
            code = YoucApiErrorAddAttentionAlreadyExists;
            break;
        default:
			code = [super apiErrorCodeFromErrorCode:code];
            break;
    }
    
    return code;
}

- (void)_dealWithJSONResponse:(id)responseObject withError:(NSError *)error
{
	YARespUserAttention *respUserAttention = [[[YARespUserAttention alloc] initWithError:error context:self.context] autorelease];
	
	respUserAttention.gameId = [self.params objectForKey:KEY_ID];
    
	if ([self.delegate respondsToSelector:@selector(userAddAttentionResponse:respUserAttention:)])
	{
		[self.delegate userAddAttentionResponse:self respUserAttention:respUserAttention];
	}
}

@end
